package com.wujunshen.dumpling.database.mysql.model;

import com.fasterxml.jackson.annotation.JsonProperty;
import com.wujunshen.dumpling.database.metadata.IColumn;
import com.wujunshen.dumpling.database.mysql.mapping.MappingField;
import lombok.Data;

/**
 * 表字段信息
 *
 * @author frankwoo
 */
@Data
public class MySqlColumn implements IColumn {
  @JsonProperty(value = "数据库名")
  @MappingField(value = "TABLE_CAT")
  private String tableCat;

  @JsonProperty(value = "是否为空")
  @MappingField(value = "IS_NULLABLE")
  private String isNullable;

  /** 表名 */
  @JsonProperty(value = "表名")
  @MappingField(value = "TABLE_NAME")
  private String tableName;

  /** 默认值 */
  @JsonProperty(value = "默认值")
  @MappingField(value = "COLUMN_DEF")
  private String columnDef;

  @JsonProperty(value = "列名")
  @MappingField(value = "COLUMN_NAME")
  private String columnName;

  /** 说明 */
  @JsonProperty(value = "备注")
  @MappingField(value = "REMARKS")
  private String remarks;

  /** 小数位 */
  @JsonProperty(value = "小数位")
  @MappingField(value = "DECIMAL_DIGITS")
  private String decimalDigits;

  @JsonProperty(value = "是否自增")
  @MappingField(value = "IS_AUTOINCREMENT")
  private String isAutoIncrement;

  @JsonProperty(value = "编号")
  @MappingField(value = "ORDINAL_POSITION")
  private String ordinalPosition;

  @JsonProperty(value = "数据类型")
  @MappingField(value = "TYPE_NAME")
  private String typeName;

  @JsonProperty(value = "是否为主键")
  @MappingField(value = "PRIMARY_KEY")
  private String primaryKey;

  /** 列类型（带长度） */
  @JsonProperty(value = "列类型（带长度）")
  @MappingField(value = "COLUMN_TYPE")
  private String columnType;

  /** 列长度 */
  @JsonProperty(value = "列长度")
  @MappingField(value = "COLUMN_LENGTH")
  private String columnLength;
}
